<?php

namespace app\adminapi\controller;

use app\common\controller\Base;

class AdminBase extends Base
{
    /**
     * 当前登录的管理员id
     * @var int
     */
    protected int $adminId = 0;

    /**
     * 当前登录的管理员信息
     * @var array
     */
    protected array $adminInfo = [];


    public function initialize(): void
    {
        parent::initialize();

        //获取用户信息
        if (!empty($this->request->adminInfo)) {
            $this->adminInfo = $this->request->adminInfo;
            $this->adminId = $this->adminInfo['admin_id'];
        }
    }

}